package com.designpatterns.adapter.objadapter;

/**
 * @author Brook
 */
public class DuckTestDrive {


    public static void main(String[] args){
        MallardDuck duck = new MallardDuck();

        WildTrurkey turkey = new WildTrurkey();
        Duck turkeyAdapter = new TurkeyAdapter(turkey);

        Turkey duckAdapter = new DuckAdapter(duck);

        System.out.println("The Turkey says....");
        turkey.gobble();
        turkey.fly();

        System.out.println("\nThe Duck says...");
        testDuck(duck);

        System.out.println("\nThe TurkeyAdapter says...");
        testDuck(turkeyAdapter);

        System.out.println("\nThe turkey says...");
        testTurkey(turkey);

        System.out.println("\nThe DuckAdapter says...");
        testTurkey(duckAdapter);

    }

    public static void testDuck(Duck duck) {
        duck.quack();
        duck.fly();
    }

    public static void testTurkey(Turkey turkey) {
        turkey.gobble();
        turkey.fly();
    }
}
